package reflection;

public class Test4 {
    public static void main(String[] args) {
        //获取系统类加载器(system Classloader)
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);
        //获取系统类加载器的父加载器-->扩展类加载器(Extension Classloader)
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(parent);
        //获取扩展类加载器的父加载器-->根加载器(c/c++)(Bootstrap Classloader)
        ClassLoader parent1 = parent.getParent();
        System.out.println(parent1);
        ClassLoader classLoader = Test4.class.getClassLoader();
        System.out.println(classLoader);
        classLoader=Object.class.getClassLoader();
        System.out.println(classLoader);
        classLoader=String.class.getClassLoader();
        System.out.println(classLoader);
        /**
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\charsets.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\deploy.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\access-bridge-64.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\cldrdata.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\dnsns.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jaccess.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jfxrt.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\localedata.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\nashorn.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunec.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunjce_provider.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunmscapi.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunpkcs11.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\zipfs.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\javaws.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\jce.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfr.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfxswt.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\jsse.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\management-agent.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\plugin.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\resources.jar;
         * C:\Program Files\Java\jdk1.8.0_221\jre\lib\rt.jar;
         * E:\IDEA project\Java-Study\target\classes;
         * E:\IDEA\install\IntelliJ IDEA 2020.1.3\lib\idea_rt.jar
         */
        System.out.println(System.getProperty("java.class.path"));
    }

}

